; Script generated with the Venis Install Wizard

; Define your application name
!define APPNAME "BreezeSCP"
!define APPNAMEANDVERSION "BreezeSCP 1.1b"

; Main Install settings
Name "${APPNAMEANDVERSION}"
InstallDir "$PROGRAMFILES\BreezeSCP"
InstallDirRegKey HKLM "Software\BreezeWorkz\${APPNAME}" ""
OutFile "C:\Documents and Settings\Administrator\Desktop\breezescp1.1b.exe"

DirText "Choose the folder in which to install ${APPNAMEANDVERSION}."

Section "BreezeSCP"

	; Set Section properties
	SetOverwrite on

	; Set Section Files and Shortcuts
	SetOutPath "$INSTDIR\"
	File "BreezeCopy.dll"
	File "BreezeConfig.exe"
	File "pscp.exe"
	CreateShortCut "$DESKTOP\Configure BreezeSCP.lnk" "$INSTDIR\BreezeConfig.exe"
	CreateDirectory "$SMPROGRAMS\BreezeSCP"
	CreateShortCut "$SMPROGRAMS\BreezeSCP\Configure BreezeSCP.lnk" "$INSTDIR\BreezeConfig.exe"
	CreateShortCut "$SMPROGRAMS\BreezeSCP\Uninstall.lnk" "$INSTDIR\uninstall.exe"
	WriteRegStr HKLM "Software\BreezeWorkz\BreezeSCP" "" "$INSTDIR"
	WriteRegStr HKLM "Software\BreezeWorkz\BreezeSCP" "SetupPath" "$INSTDIR\BreezeConfig.exe"
	WriteRegStr HKLM "Software\BreezeWorkz\BreezeSCP" "ConfigPath" "$INSTDIR\config.dat"
	WriteRegStr HKLM "Software\BreezeWorkz\BreezeSCP" "PuttySCPPath" "$INSTDIR\pscp.exe"
	RegDLL "$INSTDIR\BreezeCopy.dll"

SectionEnd

Section -FinishSection

	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe"
	WriteUninstaller "$INSTDIR\uninstall.exe"

	MessageBox MB_ICONINFORMATION "You must either reboot, or kill and restart explorer.exe before you can use BreezeSCP."

SectionEnd

;Uninstall section
Section Uninstall

	UnRegDLL "$INSTDIR\BreezeCopy.dll"

	;Remove from registry...
	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
	DeleteRegKey HKLM "Software\BreezeWorkz\BreezeSCP"

	; Delete self
	Delete "$INSTDIR\uninstall.exe"

	; Delete Shortcuts
	Delete "$DESKTOP\Configure BreezeSCP.lnk"
	Delete "$SMPROGRAMS\BreezeSCP\Configure BreezeSCP.lnk"
	Delete "$SMPROGRAMS\BreezeSCP\Uninstall.lnk"

	; Clean up BreezeSCP
	Delete "$INSTDIR\BreezeCopy.dll"
	Delete "$INSTDIR\BreezeConfig.exe"
	Delete "$INSTDIR\pscp.exe"
	Delete "$INSTDIR\config.dat"
	

	; Remove remaining directories
	RMDir "$SMPROGRAMS\BreezeSCP"
	RMDir "$INSTDIR\"

SectionEnd

Function un.onInit

	MessageBox MB_YESNO|MB_DEFBUTTON2|MB_ICONQUESTION "Remove ${APPNAMEANDVERSION} and all of its components?" IDYES DoUninstall
		Abort
	DoUninstall:

FunctionEnd

; eof